let text = require('../../../common/util/text.js')
Page({
    data: {
        xPageReady : true ,
        list : ''
    },

    onLoad: function (options) {
        this.xInit()
    },

    xInit: async function () {
        let that = this
        
        wx.cloud.callFunction({
          name: 'practice_help',
          data: {
            action: "get_faqs"
          }
        }).then(res => {
          
          for(let i in res.result){
            for(let ii in res.result[i].data){
              res.result[i].data[ii].show=false
              res.result[i].data[ii].content=text.text(res.result[i].data[ii].content)
            }
          }
         
          that.setData({
            list:res.result
          })
         })

        that.setData({
            xPageReady : false
        })
    },
    xTosee:function(e){
      let params= e.currentTarget.dataset
      let newstr = 'list['+params.i+'].data['+params.index+'].show'
      this.setData({
        [newstr]:!this.data.list[params.i].data[+params.index].show
      })
    }
    // xTodetail:function(e){
    //     let e =e.currentTarget.dataset
    //     wx.navigateTo({
    //       url: '/subtool/pages/article/detail/index?title='+e.title+'&content='+e.content,
    //     })
    // }

})